﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<InternshipManagement.Models.Company>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    CompanyCreateEdit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>CompanyCreate</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
 <% 
        
        ViewBag.CompanyOp = ViewBag.Op == "Create" ? 2 : 3;
        Html.RenderPartial("CompanyMenu"); 
    %>
  <% using (Html.BeginForm())
       { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset class="twocolumns">
        <% if (ViewBag.Op == "Create")
           { %>
        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.UserName)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.UserName)%>
            <%: Html.EditorFor(model => model.UserName)%>
        </div>
        <% }
           else
           { %>
        <%: Html.Hidden("UserName",Model.User.UserName)%>
        <% } %>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Name)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Name)%>
            <%: Html.EditorFor(model => model.Name)%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Address) %>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Address)%>
            <%: Html.TextAreaFor(model => model.Address)%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Phone)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Phone)%>
            <%: Html.EditorFor(model => model.Phone)%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Website)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Website)%>
            <%: Html.EditorFor(model => model.Website)%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Description)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Description)%>
            <%: Html.EditorFor(model => model.Description)%>
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
<% } %>

</asp:Content>
